//
// Created by yan on 7/8/17.
//

#ifndef YUNBAMOD_YUNBAMOD_HPP
#define YUNBAMOD_YUNBAMOD_HPP


#include <uploadsys/bUploadMod.h>
#include <yunbaapi/yunba_server.h>

class yunbaMod : public bUploadMod{
public:
    yunbaMod(string name) : bUploadMod(name){
        yunbaP = new yunba_server("590be540f1ae5ffe367124fe");
    }

    virtual int initcfg(){
        yunbaP->setTopic("txet1");
        yunbaP->setup();
    }

    virtual ssize_t recvData(void* buf,size_t count){
        return 0;
    }

    virtual ssize_t sendData(void* buf,size_t count){
        yunbaP->pub((char *)buf);
    }

    virtual int connect(){
        yunbaP->connect();
    }

private:
    yunba_server * yunbaP;
};




#endif //YUNBAMOD_YUNBAMOD_HPP
